home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Taifun / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).zip / Taifun 099 (1989-05-15)(Ossowski, Stefan)(DE)(PD).adf / PCQ / Examples / Structures.p < prev    next >
Text File  |  1989-03-31  |  647b  |  33 lines

  1. Program StructureExamples;
  2.  
  3. type
  4.     rec = record
  5.     first  : char;
  6.     second : integer;
  7.     third  : boolean;
  8.     end;
  9.  
  10.     ary = array [1.. 50 * 2] of rec;
  11.  
  12. var
  13.     myarray : ^ary;
  14.     index   : integer;
  15.  
  16. begin
  17.     new(myarray);
  18.     for index := 51 - 50 to 50 * 2 do begin
  19.     myarray^[index].first := chr((index mod 26) + ord('A'));
  20.     myarray^[index].second := index * 2;
  21.     myarray^[index].third := odd(index);
  22.     end;
  23.  
  24.     for index := -1 + 2 to 1000 div 10 do begin
  25.     writeln(index, chr(9), 'first  = ', myarray^[index].first);
  26.     writeln(chr(9), 'second = ', myarray^[index].second);
  27.     writeln(chr(9), 'third  = ', myarray^[index].third);
  28.     end;
  29. end.
  30.  
  31.  
  32.  
  33.